import axios from 'axios';
// import { UserState } from '@/store/modules/user/types';
import { ajaxService } from '@/utils/request';
import { getToken } from '@/utils/auth';

const env = import.meta.env;
let baseURL = env.VITE_APP_BASE_URL;
let userURL = env.VITE_USER_BASE_URL;

export function GetRouters(params: any) {
  return ajaxService({
    url: '/basis/sys/menu/get',
    method: 'get',
    baseURL: env.VITE_USER_BASE_URL,
    params,
  });
}

export function addMenus(data: any) {
  return ajaxService({
    url: '/basis/sys/menu/add',
    method: 'post',
    baseURL: userURL,
    data,
    headers: {
      Authorization: `${getToken()}`,
    },
  });
}
